﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace PookSistener
{
    public partial class frmMainForm : Form
    {
        public frmMainForm()
        {
            InitializeComponent();
        }

        private void frmMainForm_Resize(object sender, EventArgs e)
        {
            int PADDING = 12;

            int width = this.Width;
            int widthForCal = width - (PADDING * 3); // 12 for Padding (left, center, right)

            int widthForEach = (int) (widthForCal / 2);

            btnCustomer.Left = PADDING;
            btnCustomer.Width = widthForEach;
            button4.Left = btnCustomer.Right;
            button4.Width = widthForEach;

            button5.Left = PADDING;
            button5.Width = widthForEach;
            button6.Left = button5.Right;
            button6.Width = widthForEach;

            button7.Left = PADDING;
            button7.Width = widthForEach;
            button8.Left = button7.Right;
            button8.Width = widthForEach;
            button8.Visible = false;
            button7.Visible = false;
        }

        private void btnCustomer_Click(object sender, EventArgs e)
        {
            Customer.frmCustomer form = new Customer.frmCustomer();
            form.ShowDialog();
        }

        private void button4_Click(object sender, EventArgs e)
        {
            Product.frmInventory form = new Product.frmInventory();
            form.ShowDialog();
        }

        private void frmMainForm_Load(object sender, EventArgs e)
        {

        }

        private void button5_Click(object sender, EventArgs e)
        {
            SystemConfig.frmSystemConfigMainMenu form = new SystemConfig.frmSystemConfigMainMenu();
            form.ShowDialog();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            PO.frmPurchaseOrder form = new PO.frmPurchaseOrder();
            form.ShowDialog();
        }

        private void button6_Click(object sender, EventArgs e)
        {
            PO.frmListAllSellOrder frm = new PO.frmListAllSellOrder();
            frm.ShowDialog();
        }

        private void button7_Click(object sender, EventArgs e)
        {
            Customer.frmCustomerProduct frm = new Customer.frmCustomerProduct();
            frm.ShowDialog();
        }
    }
}
